<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="js/vue.js"></script>
    <title>Document</title>
    <style>
        .active{
            color: red;
        }
        .error{
            background-color: pink;
        }
    </style>
</head>
<body>
    <div id="app">
        <div :class="[activeCls,errorCls]">数组语法</div>
    </div>
    <script>
        var app = new Vue(
            {
                el:'#app',
                data:{
                    activeCls:'active',
                    errorCls:'error'
                }
            }
        )
    </script>
</body>
</html>